<template>
    <div class="mySGXKSQ">
        <div class="SQList">
            <ul>
                <div v-if="contentData.length > 0" style="position:relative" >
                    <li v-for="(item, index) in contentData" :key="index" @click="getListData1(item)">
                        <div :style="{ 'float': 'left', 'width': isnhzgChe ? '90%' : '100%' }">
                            <p style="font-weight: bold; height: 24px">
                                <span style="float: left">{{ item.HOUSEAPPLICANT }}</span>
                                <span style="float: right">
                                    <span style="padding-right:10px;color: aqua;" @click.stop="openLink">详情</span><span
                                        style="padding-left:10px;color: aqua;">进度</span>
                                </span>
                            </p>
                            <p style="font-size: 14px; color: black; height: 24px">
                                <span style="float: left">进度：{{ item.WF_NAME }}</span>
                                <span style="float: right">{{ item.PROC_CREATEDATE }}</span>
                            </p>
                            <p style="font-size: 14px; color: black; height: 24px">
                                <span style="float: left">流水号：{{ item.LSH }}</span>
                                <!-- <span style="float: right">{{ item.APPLYTIME }}</span> -->
                            </p>
                            <p style="font-size: 14px; color: black; height: 24px">
                                <span style="float: left">地址：{{ item.PERMANENTADDR || '暂无数据' }}</span>
                            </p>
                        </div>
                    </li>
                </div>
                <div v-else style="height: 60vh; text-align: center; padding-top: 20vh">
                    <div style="margin-bottom: 10px">
                        <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png" />
                    </div>
                    <div>暂无数据</div>
                </div>
            </ul>
        </div>
    </div>
</template>

<style lang="scss" scoped>
.mySGXKSQ {
    height: 100vh;
    width: 100%;
    background: #eee;

    .SQList {
        width: 100vw;
        overflow-x: hidden;
        height: calc(100vh - 96px);
        overflow: auto;
        background: #eee;
        font-size: 14px;

        li {
            padding-top: 4px;
            background-color: white;
            border-radius: 10px;
            padding: 10px;
            width: 96%;
            height: 102px;
            margin: 0 auto;
            margin-top: 4px;
            color: black;
            box-shadow: 0 0 12px #e3e3e3;
        }
    }
}
</style>

<script>
import { GJDBFunction2 } from '../../../utils/queryData'
export default {
    data() {
        return {
            contentData: [
            ],
            noData: false,
        }
    },
    mounted() {

    },
    methods: {
        async getListData() {
            const res23 = await GJDBFunction2("get_sgxkdb", [{ "i_taskid": 1 }])
            const res231 = await GJDBFunction2("get_sgxkdbV2", [{ "i_taskid": 1 }])
            this.contentData = res23.concat(res231)
        },
        async getListDataNew() {
            const res23 = await GJDBFunction2("get_sgxkdbV2", [{ "i_taskid": 1 }])
            this.contentData = res23
        },
        async openLink(){
            const res = await GJDBFunction2("get_GZZT", [{ "I_USERID": "5d3f3414-88f6-435b-adf8-0278947cc411","I_TYPE":1 }])
            // GHXKZZT：1    规划许可证已盖章
            // ZJDPZSZT：1   宅基地批准书已盖章
            // SGXKZZT：1    施工备案证已盖章
            if(res[0].GHXKZZT||res[0].ZJDPZSZT||res[0].SGXKZZT){
                this.$router.push({
                    path:"/GZXKZ",
                    query:{
                        data:JSON.stringify()
                    }
                })
            }
        },
        getListData1(data) {
            debugger
            //点击进去 如果正在办理可以看到进度  如果是办结 可以查看详情data.proc_status == 2  办结  data.proc_status == 1 正在办理
            if (data.PROC_STATUS == 2) {
                //办结 查看详情  申请：{5F605C24-CFE0-49A1-B4EC-2BA85C5FF672}
                // 变更：{D8CE8FDE-C99C-4951-870E-CD03FA9E6FB5}
                // 延期：{7A440F29-3FD5-498A-AE43-F6C4E1350B34}
                window.sessionStorage.setItem('fileData',data)
                if (data.PROC_GUID == '{5F605C24-CFE0-49A1-B4EC-2BA85C5FF672}') {
                    this.$router.push({
                        path: '/fileData',
                        query: {
                            data: JSON.stringify(data)
                        }
                    })
                } else if (data.PROC_GUID == '{D8CE8FDE-C99C-4951-870E-CD03FA9E6FB5}') {
                    window.sessionStorage.getItem('RUNTYPE') == "2"
                    this.$router.push({
                        path: '/biangeng',

                    })
                } else if (data.PROC_GUID == '{7A440F29-3FD5-498A-AE43-F6C4E1350B34}') {
                    window.sessionStorage.getItem('RUNTYPE') == "3"
                    this.$router.push({
                        path: '/biangeng',

                    })
                }
            } else if (data.PROC_STATUS == 1) {
                //查看进度
                this.$router.push({
                    path: '/KeyLine',
                    query: { PROC_GUID: data.PROC_GUID },
                })
            }
        },
    },
    created() {
        this.getListData()
    }
}
</script>